class Solution(object):
    def areAlmostEqual(self, s1, s2):
        out = []
        for i in range(len(s1)):
            if s1[i] != s2[i]:
                out.append(i)
        if not out:
            return True
        if len(out) == 2:
            if s1[out[0]] == s2[out[1]] and s1[out[1]] == s2[out[0]]:
                return True
            else:
                return False
        else:
            return False